﻿/*
using System;

namespace cs_basic_18 {
    class Program {
        static void Main(string[] args) {
            Vehicle v = new RaceCar()  ;
            v.Run();
        }
    }
  
    abstract class Vehicle {
        public void Stop() {
            Console.WriteLine("stopped");
        }

        public abstract void Run();
    } 

    class Car : Vehicle {
        public override void Run() {
            Console.WriteLine("car running");
        }
    }
    class RaceCar: Vehicle {
        public override void Run() {
            Console.WriteLine("RaceCar running");
        }
    }
}
*/

using System;

namespace cs_basic_18 {
    class Program {
        static void Main(string[] args) {
            Vehicle v = new Car();
            v.Run();
        }
    }

    interface IVehicle {
        void Run();
        void Stop();
    }

    abstract class Vehicle: IVehicle {
        public virtual void Run() {
            Console.WriteLine("Vehicle is running ...");
        }

        public abstract void Stop();
    }

    class Car : Vehicle {
        public override void Run() {
            Console.WriteLine("Car is running ...");
        }

        public override void Stop() {
            Console.WriteLine("Car is stopping ...");
        }
    }
    class Trunk: Car {
        public override void Run() {
            Console.WriteLine("Trunk is running ...");
        }

        public override void Stop() {
            Console.WriteLine("Trunk is stopping ...");
        }
    }
}